package com.cy.pj.common.util;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;

public class ServletUtil {
//    public static HttpServletResponse getResonse(){
//        ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
//        return requestAttributes.getResponse();
//    }
public static ServletRequestAttributes getRequestAttributes(){
    return (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
}

    public static HttpServletRequest getRequest(){
//        ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
        return  getRequestAttributes().getRequest();
    }
}
